/**
 * Class which holds information about a Vertex object.
 * To be stored as the "data" field of a Vertex.
 * 
 * @author Ken "David" McClain
 * @version 20 May 2011
 */
public class VertexInfo {
  
  /** Pointer to previous vertex in path. */
  private Vertex prev;
  
  /** Edge which points to the 'prev' vertex. */
  private Edge prevEdge;
  
  /** Whether or not this vertex is in the known set. */
  private boolean known;
  
  /** Distance from source vertex. */
  private double dist;
  
  /** Index of this vertex in the binary heap. */
  private int heapIndex;
  
  /** Default Constructor.*/
  public VertexInfo() {
    known = false;
    dist = 0;
    prev = null;
    prevEdge = null;
    heapIndex = 0;
  }
  
  /** Constructor which sets initial values of the object.
    * @param k known/unknown boolean
    * @param d The label of this vertex (distance to source0
    * @param p The previous vertex ("path")
    */
  public VertexInfo(boolean k, double d, Vertex p) {
    known = k;
    dist = d;
    prev = p;
    prevEdge = null;
    heapIndex = 0;
  }
  
  // SETTERS (mutators)
  public void setKnown(boolean bool) { known = bool; }
  public void setDist(double d)      { dist = d; }
  public void setPrev(Vertex p)      { prev = p; }
  public void setIndex(int i)        { heapIndex = i; }
  public void setPrevEdge(Edge e)    { prevEdge = e; }
  
  // GETTERS (accessors)
  public boolean getKnown()    { return known; }
  public double  getDist()     { return dist;  }
  public Vertex  getPrev()     { return prev;  }
  public int     getIndex()    { return heapIndex; }
  public Edge    getPrevEdge() { return prevEdge; }
  
}
  